﻿<%@ Page Title="Post Offer - Savory Housing" Language="C#" MasterPageFile="~/RealState.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="Real_Estate_Post_Offer.aspx.cs" Inherits="WebApplication.Real_Estate_Post_Offer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
  <script type="text/javascript">
      $(document).ready(function () {
          $('#<%=ddlCountry.ClientID%>').change(getCity);
          $('#<%=ddlProperty.ClientID%>').change(getProperty);
          $('#<%=ddlCountry.ClientID%>').change(getCurrency); 
          $('#<%=ddlCity.ClientID%>').append(new Option('City', ' City', false));
          $('#<%=ddlPropertyType.ClientID%>').append(new Option('Property Type', 'Property Type', false));


          $(":input[title]").each(function () {
              $(this).val($(this).attr("title"));
              $(this).bind('focus', function () {
                  if ($(this).val() == $(this).attr("title")) $(this).val('');
              });
              $(this).bind('blur', function () {
                  if ($(this).val() == '') $(this).val($(this).attr("title"));
              });
          });

      });     
      function getProperty() {
          $("select[id$=ddlPropertyType] > option").remove();
          $('#<%=ddlPropertyType.ClientID%>').append(new Option('Property Type', 'Property Type', false));
          $.ajax({
              type: "POST",
              url: "/CountryService.asmx/GetPropertyType",
              data: "{Property: '" + $('#MainContent_ddlProperty').val() + "'}",
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (response) {
                  var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                  for (var i = 0; i < models.length; i++) {

                      var val = models[i];
                      var text = models[i];
                      $('#MainContent_ddlPropertyType').append(new Option(text, val, false));
                  }

              },
              error: function (XMLHttpRequest, textStatus, errorThrown) {
              }

          });
      }

      function getCity() {
          $("select[id$=ddlCity] > option").remove();
          $('#<%=ddlCity.ClientID%>').append(new Option('City', 'City', false));
          $.ajax({
              type: "POST",
              url: "/CountryService.asmx/GetCity",
              data: "{Country: '" + $('#MainContent_ddlCountry').val() + "'}",
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (response) {
                  var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                  for (var i = 0; i < models.length; i++) {
                      var val = models[i];
                      var text = models[i];
                      $('#MainContent_ddlCity').append(new Option(text, val, false));
                  }

              },
              error: function (XMLHttpRequest, textStatus, errorThrown) {
              }

          });
      }
      function getCurrency() {
          $.ajax({
              type: "POST",
              url: "/CountryService.asmx/GetCurrency",
              data: "{Country: '" + $('#MainContent_ddlCountry').val() + "'}",
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (response) {
                  //var objectvalue = jQuery.parseJSON(response.d);
                  $('#MainContent_txtPriceM2').val(response.d);

              },
              error: function (XMLHttpRequest, textStatus, errorThrown) {
              }

          });
      }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <div class="left">
  <h3 class="white_db_box nfont dark_gray" style="width:255px; margin-left:15px;">Real Estate Post Offer</h3>
  <div class="clear"></div>
  <dl class="form clearfix" style="margin-left:15px;">
    <dt> <br />
      <div>
        <asp:RequiredFieldValidator ID="reqtxtTotalPrice" runat="server" Text="Please enter Total Price" ControlToValidate="txtTotalPrice" CssClass="error" InitialValue="Total Price" ErrorMessage="Please enter Total Price"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqtxtPriceM2" runat="server" ControlToValidate="txtPriceM2" CssClass="error" InitialValue="Currency" ErrorMessage="Please enter valid price per Sq. Meter" Text="Please enter valid price per sq. Meter"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqddlPriceMode" runat="server" ControlToValidate="ddlPriceMode" CssClass="error" InitialValue="Mode" ErrorMessage="Please Select Mode" Text="Please Select Mode"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqlotarea" runat="server" ControlToValidate="txtlotarea" CssClass="error" InitialValue="Lot Area (m2)" ErrorMessage="Please enter lot area in (m2)" Text="Please enter lot area in (m2)"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqtxtArea" runat="server" ControlToValidate="txtArea" CssClass="error" InitialValue="Building Area (m2)" ErrorMessage="Please enter building area in (m2)" Text="Please enter building area in (m2)"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqddlPropertyType" runat="server" ControlToValidate="ddlPropertyType" CssClass="error" InitialValue="Property Type" ErrorMessage="Please select property type" Text="Please select property type"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqddlProperty" runat="server" ControlToValidate="ddlProperty" CssClass="error" InitialValue="Category" ErrorMessage="Please select category" Text="Please select category"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqtxtLandline" runat="server" ControlToValidate="txtLandline" CssClass="error" InitialValue="Landline Number" ErrorMessage="Please enter landline number" Text="Please enter landline number"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtNeighborhood" CssClass="error" InitialValue="Neighborhood" ErrorMessage="Please enter neighborhood" Text="Please enter neighborhood"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqddlCity" runat="server"  ControlToValidate="ddlCity" CssClass="error" InitialValue="City" ErrorMessage="Please select city" Text="Please select city"></asp:RequiredFieldValidator>
        <asp:RequiredFieldValidator ID="reqCountry" runat="server" CssClass="error" ControlToValidate="ddlCountry" InitialValue="Country" ErrorMessage="Please select country" Text="Please select country"></asp:RequiredFieldValidator>              
           </div>
      <p class="purple" style="padding:0px 0px 0px 0px;"><strong>Location</strong></p>
      <div style="height:5px;"></div>
      <div class="res_ad">
        <asp:DropDownList ID="ddlCountry" runat="server" CssClass="form-text wdth150"></asp:DropDownList>
      </div>
      <div class="res_ad">
        <asp:DropDownList ID="ddlCity" runat="server" CssClass="form-text wdth150"> </asp:DropDownList>
      </div>
      <div class="res_ad">
        <asp:TextBox ID="txtNeighborhood" runat="server" MaxLength="20" CssClass="form-text wdth150_inp" title="Neighborhood"></asp:TextBox>
      </div>
      <div class="res_ad">
        <asp:TextBox ID="txtLandline" runat="server" MaxLength="20" CssClass="form-text wdth150_inp" title="Landline Number"></asp:TextBox>
      </div>
      <div class="clear"></div>
    </dt>
    <dt>
      <p class="purple" style="padding:10px 0px 0px 0px;"><strong>Real Estate</strong></p>
      <div style="height:5px;"></div>
      <div class="res_ad">
        <asp:DropDownList ID="ddlProperty"  runat="server" CssClass="form-text wdth150"> </asp:DropDownList>
      </div>
      <div class="res_ad">
        <asp:DropDownList ID="ddlPropertyType" runat="server" CssClass="form-text wdth150"> </asp:DropDownList>
      </div>
        <div class="res_ad">
        <asp:TextBox ID="txtArea" runat="server" MaxLength="10" CssClass="form-text wdth150_inp" title="Building Area (m2)"></asp:TextBox>
        
        </div>
        <div class="res_ad">
            <asp:TextBox ID="txtlotarea" runat="server" MaxLength="10" CssClass="form-text wdth150_inp" title="Lot Area (m2)"></asp:TextBox>
        </div>
        
      <div class="clear"></div>
      <p class="purple" style="padding:10px 0px 0px 0px;"><strong>Residential Commercial Types</strong></p>
      <div style="height:5px;"></div>
      <div class="clear"></div>
      <div class="res_ad">
        <asp:DropDownList ID="ddlbedrooms" runat="server" CssClass="form-text wdth150">
          <asp:ListItem Text="Bedrooms" />
          <asp:ListItem Text="1" />
          <asp:ListItem Text="2" />
          <asp:ListItem Text="3" />
          <asp:ListItem Text="4" />
          <asp:ListItem Text="5" />
          <asp:ListItem Text="6" />
          <asp:ListItem Text="7" />
          <asp:ListItem Text="8" />
          <asp:ListItem Text="9" />
          <asp:ListItem Text="10" />
        </asp:DropDownList>
      </div>
      <div class="res_ad">
        <asp:DropDownList ID="ddlBathRooms" runat="server" CssClass="form-text wdth150">
          <asp:ListItem Text="Bath Rooms" />
          <asp:ListItem Text="1" />
          <asp:ListItem Text="2" />
          <asp:ListItem Text="3" />
          <asp:ListItem Text="4" />
          <asp:ListItem Text="5" />
          <asp:ListItem Text="6" />
          <asp:ListItem Text="7" />
          <asp:ListItem Text="8" />
          <asp:ListItem Text="9" />
          <asp:ListItem Text="10" />
        </asp:DropDownList>
      </div>
      <div class="clear"></div>
    </dt>
    <dt>
      <p class="purple" style="padding:10px 0px 0px 0px;"><strong>Price</strong></p>
      <div style="height:5px;"></div>
      <div class="res_ad">
        <asp:DropDownList ID="ddlPriceMode" runat="server" CssClass="form-text wdth150">
          <asp:ListItem Text="Mode" />
        </asp:DropDownList>
        
      </div>
      <div class="res_ad">
        <asp:TextBox ID="txtPriceM2" runat="server" CssClass="form-text wdth150_inp" title="Currency"  MaxLength="20" ></asp:TextBox>
      </div>
      <div class="res_ad">
        <asp:TextBox ID="txtTotalPrice" runat="server" CssClass="form-text wdth150_inp" MaxLength="20" title="Total Price" ></asp:TextBox>
      </div>
      <div class="clear"></div>
    </dt>
    <dt>
      <p class="purple" style="padding:0px 0px 0px 0px;"><strong>Picture Load</strong></p>
      <div style="height:5px;"></div>
      <div class="res_ad">Main <br />
        <asp:FileUpload ID="upMain" CssClass="form-text wdth300" runat="server" />
      </div>
      <div class="res_ad"><br />
        4 others <br />
        <asp:FileUpload ID="up1" CssClass="form-text wdth300" runat="server" />
        <asp:FileUpload ID="up2" CssClass="form-text wdth300" runat="server" style="margin-left:6px;"/>
        <div style="height:10px;"></div>
        <asp:FileUpload ID="up3" CssClass="form-text wdth300" runat="server" />
        <asp:FileUpload ID="up4" CssClass="form-text wdth300" runat="server" style="margin-left:6px;" />
      </div>
      <div class="clear"></div>
    </dt>
    <dt>
      <div style="height:15px;"></div>
      <label>
     
       <asp:CheckBox ID="chkNewsLatter" runat="server" />
        <span class="blue">Confirm Above Information </span></label>
    
       
    </dt>
    <dt> <br />
      <asp:Button ID="cmdSave" runat="server" CssClass="reg-blue-round-btn w75" Text="Load" OnClick="btn_Save" />
    </dt>
  </dl>
    </div>
    
  </div>
</asp:Content>
